﻿<?xml version="1.0" encoding="utf-8" ?>
<Kuree>
  <Command>
    <Name>halt</Name>
    <Description>Halt program</Description>
    <Usage>None</Usage>
    <Syntax>\d{1,}\s{1,}halt</Syntax>
  </Command>
  <Command>
    <Name>read</Name>
    <Description>Place user input in register rX</Description>
    <Usage>read rX</Usage>
    <Syntax>\d{1,}\s{1,}read\s{1,}r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>write</Name>
    <Description>Print the contents of register rX</Description>
    <Usage>write rX</Usage>
    <Syntax>\d{1,}\s{1,}write\s{1,}r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>nop</Name>
    <Description>Do nothing</Description>
    <Usage>None</Usage>
    <Syntax>\d{1,}\s{1,}nop</Syntax>
  </Command>
  <Command>
    <Name>setn</Name>
    <Description>Set register rX to the integer N (-128 to 127)</Description>
    <Usage>setn rX, N</Usage>
    <Syntax>\d{1,}\s{1,}setn\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))-?\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>addn</Name>
    <Description>Add integer N (-128 to 127) to register rX</Description>
    <Usage>addn rX, N</Usage>
    <Syntax>\d{1,}\s{1,}addn\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))-?\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>copy</Name>
    <Description>Set rX = rY</Description>
    <Usage>copy rX, rY</Usage>
    <Syntax>\d{1,}\s{1,}copy\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>add</Name>
    <Description>Set rX = rY  +  rZ</Description>
    <Usage>add rX, rY, rZ</Usage>
    <Syntax>\d{1,}\s{1,}add\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>sub</Name>
    <Description>Set rX = rY  -  rZ</Description>
    <Usage>sub rX, rY, rZ</Usage>
    <Syntax>\d{1,}\s{1,}sub\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>neg</Name>
    <Description>Set rX = -rY</Description>
    <Usage>neg rX, rY</Usage>
    <Syntax>\d{1,}\s{1,}neg\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>mul</Name>
    <Description>Set rX = rY  *  rZ </Description>
    <Usage>mul rX, rY, rZ </Usage>
    <Syntax>\d{1,}\s{1,}mul\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>div</Name>
    <Description>Set rX = rY  /  rZ</Description>
    <Usage>div rX, rY, rZ</Usage>
    <Syntax>\d{1,}\s{1,}div\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>mod</Name>
    <Description>Set rX = rY  %  rZ</Description>
    <Usage>mod rX, rY, rZ</Usage>
    <Syntax>\d{1,}\s{1,}mod\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>jumpn</Name>
    <Description>Set program counter to address N</Description>
    <Usage>jumpn N</Usage>
    <Syntax>\d{1,}\s{1,}jumpn\s{1,}\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>jumpr</Name>
    <Description>Set program counter to address in rX</Description>
    <Usage>jumpr rX</Usage>
    <Syntax>\d{1,}\s{1,}jumpr\s{1,}r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>jeqzn</Name>
    <Description>If rX  ==  0 then set program counter to address N</Description>
    <Usage>jeqzn rX, N</Usage>
    <Syntax>\d{1,}\s{1,}jeqzn\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>jnezn</Name>
    <Description>If rX  !=  0 then set program counter to address N</Description>
    <Usage>jnezn rX, N</Usage>
    <Syntax>\d{1,}\s{1,}jnezn\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>jgtzn</Name>
    <Description>If rX  >  0 then set program counter to address N</Description>
    <Usage>jgtzn rX, N</Usage>
    <Syntax>\d{1,}\s{1,}jgtzn\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>jltzn</Name>
    <Description>If rX  &lt;  0 then set program counter to address N</Description>
    <Usage>jltzn rX, N</Usage>
    <Syntax>\d{1,}\s{1,}jltzn\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>calln</Name>
    <Description>Set rX to program counter + 1, then set program counter to address N</Description>
    <Usage>calln rX, N</Usage>
    <Syntax>\d{1,}\s{1,}calln\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>loadn</Name>
    <Description>Load register rX with contents of memory address N</Description>
    <Usage>loadn rX, N</Usage>
    <Syntax>\d{1,}\s{1,}loadn\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>storen</Name>
    <Description>Store contents of register rX into memory address N</Description>
    <Usage>storen rX, N</Usage>
    <Syntax>\d{1,}\s{1,}storen\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))\d{1,}</Syntax>
  </Command>
  <Command>
    <Name>loadr</Name>
    <Description>Load register rX with data from the address location held in register rY</Description>
    <Usage>loadr rX, rY</Usage>
    <Syntax>\d{1,}\s{1,}loadr\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}</Syntax>
  </Command>
  <Command>
    <Name>storer</Name>
    <Description>Store contents of register rX into memory address held in register rY</Description>
    <Usage>storer rX, rY</Usage>
    <Syntax>\d{1,}\s{1,}storer\s{1,}r\d{1,2}((\s*,\s*)|(\s{1,}))r\d{1,2}</Syntax>
  </Command>
</Kuree>